package com.cw2.behavioral.observer;

/**
 * 观察者模式
 */
public class MainTest {
    public static void main(String[] args) {
        MMTikToker mmTikToker = new MMTikToker();
        mmTikToker.startSell();

        // 增加粉丝
        HumanFans humanFans = new HumanFans();
        humanFans.follow(mmTikToker);
        RobotFans robotFans1 = new RobotFans();
        RobotFans robotFans2 = new RobotFans();
        RobotFans robotFans3 = new RobotFans();
        robotFans1.follow(mmTikToker);
        robotFans2.follow(mmTikToker);
        robotFans3.follow(mmTikToker);

        // 开启直播
        mmTikToker.startSell();

        // 关闭直播
        mmTikToker.endSell();
    }
}
